#include "GameClient.h"

GameClient& GameClient::instance()
{
	static GameClient instance;
	return instance;
}

GameClient::GameClient()
	: m_stopQuery(false)
	, m_luaState(lua_open())
	, m_pDominionMgr(new Dominion())
	, m_gameStarted(false)
	, m_registeredFunctions(false)
	, m_versionSynched(false)
	, m_charLoaded(false)
	, m_ownHeroSpawned(false)
	, m_queryThreadStarted(false)
	, m_loadingScreenThreadStarted(false)
{
	//Initialize lua stuff
	try
	{
		luaL_openlibs(m_luaState);
		luabind::open(m_luaState);
	}
	catch (const std::exception &e)
	{
		std::cout << "GameClient::__init__(): LUA_ERROR" << std::endl;
	}
}

GameClient::~GameClient()
{}

std::string createDump(byte *pData, int dataSize)
{
	static std::stringstream	ss;
	char				hexDump[10];
	long				width = 16;

	ss.str("");
	ss << " | Size (" << dataSize << ")" << std::endl;

	for (int i = 0; i < dataSize; i += width)
	{
		//Hex
		for (int j = 0; j < width; ++j)
		{
			if (i > dataSize)
				break;

			sprintf_s(hexDump, 10, "%02X \0", pData[j + i]);
			ss.write(hexDump, strlen(hexDump));
		}

		ss << "  ";

		//Ascii
		for (int j = 0; j < width; ++j)
		{
			if (i > dataSize)
				break;

			sprintf_s(hexDump, 10, "%c\0", pData[j + i]);

			if (hexDump[0] < 32)
				strcpy(hexDump, ".\0");

			ss.write(hexDump, strlen(hexDump));
		}

		ss << std::endl;
	}

	return ss.str();
}

void restart()
{
	STARTUPINFOA si;
	PROCESS_INFORMATION pi;

	ZeroMemory(&si, sizeof(si));
	ZeroMemory(&pi, sizeof(pi));

	si.cb = sizeof(si);

	CreateProcessA("ClientEmu.exe", GetCommandLineA(), NULL, NULL, false, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &si, &pi);
	Sleep(500);

	exit(ERROR_SUCCESS);
}

void onTerminate()
{
	std::cout << "ONTERMINATE!" << std::endl;
	restart();
}

LONG WINAPI CrashHandler(EXCEPTION_POINTERS*)
{
	std::cout << "CRASH! UNHANDLED EXCEPTION CAUGHT!" << std::endl;
	std::cout << "RESTARTING..." << std::endl;
	restart();

	return 0;
}

LONG WINAPI SetUnhandledHook(EXCEPTION_POINTERS*)
{
	//FUCK YOU CRT!
	return 0;
}

void GameClient::initialize(const std::string &serverIp, uint16_t serverPort, const std::string &handshakeToken, const std::string &encryptionKey, double summonerId, std::string botType, std::string levelLimit)
{
	//Last option for unhandled exceptions
	SetUnhandledExceptionFilter(CrashHandler);
	set_terminate(onTerminate);
	set_unexpected(onTerminate);

	//Hook SetUnhandled... because our handler gets erased by the CRT
	DetourFunction((BYTE*)SetUnhandledExceptionFilter, (BYTE*)SetUnhandledHook);

	//m_logFile.open("consoleLog_" + std::to_string(summonerId) + ".txt", std::fstream::out | std::fstream::app);
	//std::cout.rdbuf(m_logFile.rdbuf());

	std::cout << std::endl << std::endl << "#BEGIN#=>" << std::endl;

	m_botType = botType;
	m_levelLimit = levelLimit;
	m_summonerId = summonerId;

	if (enet_initialize() != 0)
	{
		std::cout << "Could not initialize ENet!" << std::endl;
		Sleep(10000);
		restart();
	}

	m_pClient = enet_host_create(nullptr, 32, 0, 0);
	if (!m_pClient)
	{
		std::cout << "Could not create host!" << std::endl;
		enet_deinitialize();
		Sleep(10000);
		restart();
	}

	//Blowfish
	auto finalKey = base64_decode(encryptionKey);
	m_pBlowfish = new BlowFish((unsigned char*)finalKey.c_str(), 16);

	ENetAddress address;
	ENetEvent	event;

	address.host = inet_addr(serverIp.c_str());
	address.port = serverPort;

	std::cout << "Connecting to: " << serverIp << ":" << serverPort << std::endl;
	m_pServerPeer = enet_host_connect(m_pClient, &address, 8);

	if (!m_pServerPeer)
	{
		std::cout << "No available peers for connecting!" << std::endl;
		enet_host_destroy(m_pClient);
		enet_deinitialize();
		Sleep(10000);
		restart();
	}

	/* Wait up to 5 seconds for the connection attempt to succeed. */
	if (enet_host_service(m_pClient, &event, 10000) <= 0 ||
		event.type != ENET_EVENT_TYPE_CONNECT)
	{
		enet_peer_reset(m_pServerPeer);
		enet_host_destroy(m_pClient);
		enet_deinitialize();
		std::cout << "Could not connect!" << std::endl;
		Sleep(15000);

		restart();
	}

	//Connected
	m_pServerPeer->mtu = 996;
	std::cout << "Connected!" << std::endl;

	//Send KeyCheck Packet
	KeyCheck keyCheckPacket;

	keyCheckPacket.partialKey[0] = finalKey.at(1);
	keyCheckPacket.partialKey[1] = finalKey.at(2);
	keyCheckPacket.partialKey[2] = finalKey.at(3);

	keyCheckPacket.userId = summonerId;
	m_pBlowfish->Encrypt((unsigned char*)&keyCheckPacket.userId, (unsigned char*)&keyCheckPacket.checkId, 8, BlowFish::ECB);

	sendPacket((uint8_t*)&keyCheckPacket, sizeof(KeyCheck), CHL_HANDSHAKE);

	//Initialize LUA Interface
	try
	{
		registerLuaFunctions();

		//Decide which script gets loaded
		if (m_levelLimit == "LEVEL_30")
		{
			luaL_dofile(m_luaState, "COOPvsAI.lua");
			luabind::call_function<void>(m_luaState, "onLoad");
		}
		else
		{
			luaL_dofile(m_luaState, "Dominion.lua");
			luabind::call_function<void>(m_luaState, "onLoad");
		}
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onLoad (GameClient.cpp - 146) ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "UNKNOWN_ERROR: " << e.what() << std::endl;
	}

	//ENet Loop
	while (enet_host_service(m_pClient, &event, 60000) > 0)
	{
		switch (event.type)
		{
		case ENET_EVENT_TYPE_RECEIVE:
			handlePackets(event.packet);
			enet_packet_destroy(event.packet);
			break;

		case ENET_EVENT_TYPE_DISCONNECT:
			std::cout << "Disconnected!" << std::endl;
			enet_peer_disconnect(m_pServerPeer, 0);
			enet_host_destroy(m_pClient);
			enet_deinitialize();
			Sleep(15000);
			restart();
			break;
		}
	}

	std::cout << "NO PACKETS RECEIVED!!!!!!!!!! => RESTARTING" << std::endl;
	//enet_deinitialize();
	restart();
}

void GameClient::sendPacket(uint8_t *data, uint32_t length, uint8_t channel, uint32_t flag)
{
	ENetPacket *packet = enet_packet_create(data, length, flag);

	//if (m_botType == "HOST")
	//	m_logFile << "[SENT]" << std::endl << createDump(data, length).c_str() << std::endl;

	if (enet_peer_send(m_pServerPeer, channel, packet) < 0)
	{
		std::cout << "Could not send packet!" << std::endl;
	}
}

void GameClient::sendEncryptedPacket(uint8_t *data, uint32_t length, uint8_t channel, uint32_t flag)
{
	//if (m_botType == "HOST")
	//	m_logFile << "[SENT]" << std::endl << createDump(data, length).c_str() << std::endl;

	if (length >= 8)
		m_pBlowfish->Encrypt(data, length - (length % 8)); //Encrypt everything minus the last bytes that overflow the 8 byte boundary

	ENetPacket *packet = enet_packet_create(data, length, flag);

	if (enet_peer_send(m_pServerPeer, channel, packet) < 0)
	{
		//std::cout << "Could not send packet!" << std::endl;
	}
}

//luabind::object GameClient::getHeroes(lua_State *luaState)
//{
//	luabind::object result = luabind::newtable(luaState);
//
//	for (int i = 0; i < m_heroes.size(); ++i)
//	{
//		//Because lua tables start at 1 and not 0
//		result[i + 1] = luabind::object(luaState, m_heroes.at(i), luabind::adopt(luabind::result));
//	}
//
//	return result;
//}

std::string GameClient::getOwnSummonerName()
{
	return m_ownSummonerName;
}

void GameClient::lockCamera(bool doLock)
{
	LockCamera lockPacket(doLock);
	sendEncryptedPacket((uint8_t*)&lockPacket, sizeof(LockCamera), CHL_C2S);
}

void GameClient::sendExitChat()
{
	uint8_t exitChatData[] =
	{ 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x00, 0x60, 0xE5, 0x15, 0x00, 0x01, 0x00, 0x00, 0x00, 0x30, 0xA7, 0x71, 0x00, 0x30, 0xA7, 0x71, 0x00, 0x6C, 0xE5, 0x15, 0x00, 0x54, 0x8A, 0x6B, 0x01, 0x90, 0xFA, 0x45, 0x58, 0x49, 0x54, 0x4E, 0x4F, 0x57, 0x00 };
	sendEncryptedPacket((uint8_t*)&exitChatData, sizeof(exitChatData), CHL_COMMUNICATION);

	enet_host_flush(m_pClient);
	exit(0);
}

void GameClient::log(const char* msg)
{
	std::cout << msg << std::endl;
}

void GameClient::registerLuaFunctions()
{
	if (m_registeredFunctions)
		return;

	m_registeredFunctions = true;

	//Classes
	luabind::module(m_luaState)
		[
			luabind::class_<GameClient>("GameClient")
			.def("getOwnSummonerName", &GameClient::getOwnSummonerName)
		.def("sendExitChat", &GameClient::sendExitChat)
		.def("lockCamera", &GameClient::lockCamera)
		.def("log", &GameClient::log)
		.def_readonly("botType", &GameClient::m_botType),

		Entity::registerLuaFunctions(),
		Hero::registerLuaFunctions(),
		Minion::registerLuaFunctions(),
		HeroManager::registerLuaFunctions(),
		MinionManager::registerLuaFunctions(),
		Dominion::registerLuaFunctions()
		];

	//Global vars
	luabind::globals(m_luaState)["DominionMgr"] = m_pDominionMgr;
	luabind::globals(m_luaState)["HeroMgr"] = &m_heroManager;
	luabind::globals(m_luaState)["MinionMgr"] = &m_minionManager;
	luabind::globals(m_luaState)["Client"] = boost::ref(GameClient::instance());
}

DWORD GameClient::queryThread(void*)
{
	while (!instance().m_stopQuery)
	{
		QueryStatusReq queryReq;
		instance().sendEncryptedPacket((uint8_t*)&queryReq, sizeof(QueryStatusReq), CHL_C2S);

		Sleep(1000);
	}

	return 0;
}

DWORD GameClient::loadingScreenThread(void*)
{
	uint8_t realData[] =
	{ 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xC8, 0x42, 0xE0, 0x4F, 0x23, 0x41, 0x02, 0x00, 0x44, 0x00 };

	uint8_t percentageData[] =
	{ 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x20, 0xA7, 0x44, 0xE0, 0x4F, 0x23, 0x41, 0x02, 0x00, 0x44, 0x00 };

	realData[5] = (uint8_t)instance().m_pServerPeer->outgoingPeerID;

	while (!instance().m_gameStarted)
	{
		memcpy(&percentageData, realData, sizeof(realData));

		instance().sendEncryptedPacket((uint8_t*)&percentageData, sizeof(percentageData), CHL_C2S);

		Sleep(2500);
	}

	return 0;
}

void hexDump(const char *desc, void *addr, int len) {
	int i;
	unsigned char buff[17];
	unsigned char *pc = (unsigned char*)addr;

	// Output description if given.
	if (desc != NULL)
		printf("%s:\n", desc);

	// Process every byte in the data.
	for (i = 0; i < len; i++) {
		// Multiple of 16 means new line (with line offset).

		if ((i % 16) == 0) {
			// Just don't print ASCII for the zeroth line.
			if (i != 0)
				printf("  %s\n", buff);

			// Output the offset.
			printf("  %04x ", i);
		}

		// Now the hex code for the specific character.
		printf(" %02x", pc[i]);

		// And store a printable ASCII character for later.
		if ((pc[i] < 0x20) || (pc[i] > 0x7e))
			buff[i % 16] = '.';
		else
			buff[i % 16] = pc[i];
		buff[(i % 16) + 1] = '\0';
	}

	// Pad out last line if not exactly 16 characters.
	while ((i % 16) != 0) {
		printf("   ");
		i++;
	}

	// And print the final ASCII bit.
	printf("  %s\n", buff);
}

void GameClient::handlePackets(ENetPacket *packet, bool doDecrypt)
{
	if (packet == nullptr)
		return;

	PacketHeader *header = (PacketHeader*)packet->data;

	if (header == nullptr)
		return;

	if (packet->dataLength >= 8 && header->cmd != PKT_S2C_QueryStatusAns && doDecrypt)
	{
		m_pBlowfish->Decrypt(packet->data, packet->dataLength - (packet->dataLength % 8));
	}

	//if (packet->dataLength < 1000 && m_botType == "HOST" && header->cmd != PKT_Batch)
	//	m_logFile << "[RECV]" << std::endl << createDump(packet->data, packet->dataLength).c_str() << std::endl;

	switch (header->cmd)
	{
	case PKT_Batch:
		handleBatch(packet);
		break;

	case PKT_KeyCheck:
		handleKeyCheck(packet);
		break;

	case PKT_World_SendGameNumber:
		handleSendGameNumber(packet);
		break;

	case PKT_S2C_QueryStatusAns:
		handleQueryStatusAns(packet);
		break;

	case PKT_S2C_HeroSpawn:
		handleHeroSpawn(packet);
		break;

	case PKT_S2C_SynchVersion:
		handleSynchVersion(packet);
		break;

	case PKT_S2C_Ping_Load_Info:
		handlePingLoadInfo(packet);
		break;

	case PKT_S2C_StartGame:
		handleStartGame(packet);
		break;

	case PKT_S2C_StartSpawn:
		handleStartSpawn(packet);
		break;

	case PKT_S2C_EndSpawn:
		handleEndSpawn(packet);
		break;

	case PKT_S2C_LevelPropSpawn:
		handleLevelPropSpawn(packet);
		break;

	case PKT_S2C_TurretSpawn:
		handleTurretSpawn(packet);
		break;

	case PKT_ChatBoxMessage:
		handleChatBoxMessage(packet);
		break;

	case PKT_S2C_MoveAns:
		handleMoveAns(packet);
		break;

	case PKT_S2C_SetScoreForTeamDominion:
		handleSetScoreForTeamDominion(packet);
		break;

	case PKT_S2C_Announce:
		handleAnnounce(packet);
		break;

	case PKT_S2C_CharStats:
		handleCharStats(packet);
		break;

		//case 0x85:
		//	handleCharStats(packet);
		//	break;

	case PKT_S2C_SpawnDominionTurret:
		handleSpawnDominionTurret(packet);
		break;

	case PKT_S2C_DominionTurretCaptured:
		handleDominionTurretCaptured(packet);
		break;

	case PKT_S2C_EndGame:
		handleEndGame(packet);
		break;

	case PKT_S2C_LevelUp:
		handleLevelUp(packet);
		break;

	case PKT_S2C_ChampionDie:
		handleChampionDie(packet);
		break;

	case PKT_S2C_ChampionRespawn:
		handleChampionRespawn(packet);
		break;

	case PKT_S2C_BuyItemAns:
		handleBuyItem(packet);
		break;

	case PKT_S2C_ObjectSpawn:
		handleObjectSpawn(packet);
		break;

	case PKT_S2C_NPC_Die:
		handleNpcDie(packet);
		break;

	case PKT_S2C_BeginAutoAttack:
		handleBeginAutoAttack(packet);
		break;

	case PKT_S2C_NextAutoAttack:
		handleNextAutoAttack(packet);
		break;

	case PKT_S2C_StopAutoAttack:
		handleStopAutoAttack(packet);
		break;

		//Ignore deformed batch packets
	case 0x2:
		break;

	default:
		;
	}
}

void GameClient::handleBatch(ENetPacket *packet)
{
	//Thank you spudgy :)
	/*
	[22:04] <spudgy> it reutilizes the networkID depending on flags
[22:05] <spudgy> BYTE flag = p.Decode1();
[22:05] <spudgy> if((flag & 1) == 0) {
[22:05] <spudgy> szHeader = &p.buffer[p.pos];
[22:05] <spudgy> dwHeader = p.Decode1();
[22:05] <spudgy> }
[22:05] <spudgy>
[22:05] <spudgy> if(flag & 2)
[22:05] <spudgy> dwFirst4Bytes += (char)p.Decode1();
[22:05] <spudgy> else
[22:05] <spudgy> dwFirst4Bytes = p.Decode4();
[22:05] <spudgy> dwLen = flag >> 2;
[22:05] <spudgy> if(dwLen == 0x3F)
[22:05] <spudgy> http://privatepaste.com/9889076d47/xxt
[22:11] <spudgy> ^ how to parse batched packets
[22:17] == IamEddy [cf0694f8@gateway/web/freenode/ip.207.6.148.248] has joined #riotcontrol
[22:17] == eddy5641 [cf0694f8@gateway/web/freenode/ip.207.6.148.248] has quit [Ping timeout: 240 seconds]
[22:20] <Omdihar> ty :)!
[22:24] <Omdihar> In my case flag should be 6 right?
[22:27] <spudgy> no, the first batched packet is different
[22:28] <spudgy> 06 is the number of nested packets
[22:28] <spudgy> 38 is the lenght
[22:28] <spudgy> B9 Header
[22:29] <spudgy> 06 00 00 40 networkID
[22:29] <spudgy> next 33 bytes is data, than you start reading flags and processing batched
[22:29] <spudgy> CLoLPacket p2(dwHeader);
[22:29] <spudgy> p2.bBatched = TRUE;
[22:29] <spudgy> p2.Encode4(dwFirst4Bytes);
[22:29] <spudgy> p2.lpBatch = &p.buffer[p.pos];
[22:29] <spudgy> for(UINT j = 0; j < dwLen;j++)
[22:29] <spudgy> p2.Encode1(p.Decode1());
[22:29] <spudgy> HandlePacket(&p2);
[22:32] <Omdihar> thank you :-)!
	*/
	//m_logFile << "[RECV]" << std::endl << createDump(packet->data, packet->dataLength).c_str() << std::endl;

	uint8_t packetCount = *(packet->data + 1) - 1; // minus first packet
	uint32_t firstPacketLength = *(packet->data + 2);
	uint16_t processedBytes = firstPacketLength;
	uint8_t packetCmd = 0;
	uint32_t firstFourBytes = 0;
	uint32_t packetLen = 0;
	MemoryStream fixedStream;

	//Loop through first packet
	ENetPacket *firstPacket = enet_packet_create(packet->data + 3, firstPacketLength, 1);
	handlePackets(firstPacket, false);
	enet_packet_destroy(firstPacket);

	for (int i = 0; i < packetCount; ++i)
	{
		packetCmd = 2;
		fixedStream.clear();
		uint8_t flag = *(packet->data + processedBytes + 3);
		++processedBytes;

		if ((flag & 1) == 0)
		{
			packetCmd = *(packet->data + processedBytes + 3);
			++processedBytes;
		}

		if (flag & 2)
		{
			firstFourBytes += (uint8_t)*(packet->data + processedBytes + 3);
			++processedBytes;
		}
		else
		{
			firstFourBytes = *(uint32_t*)(packet->data + processedBytes + 3);
			processedBytes += 4;
		}

		packetLen = flag >> 2;
		if (packetLen == 0x3F)
		{
			packetLen = *(packet->data + processedBytes + 3);
			++processedBytes;
		}

		fixedStream << packetCmd;
		fixedStream << firstFourBytes;

		for (int j = 0; j < packetLen; ++j)
			fixedStream << *(packet->data + processedBytes + 3 + j);

		processedBytes += packetLen;

		//Handle packet here
		ENetPacket *fixedPacket = enet_packet_create(fixedStream.getPtr<uint8_t*>(), fixedStream.size(), 1);

		//Something went wrong
	/*	if (*fixedPacket->data == 2)
		{
			m_logFile << "[RECV]" << std::endl << createDump(packet->data, packet->dataLength).c_str() << std::endl;
		}*/

		handlePackets(fixedPacket, false);
		enet_packet_destroy(fixedPacket);
	}

	//ENetPacket *fixedPacket = enet_packet_create(byteVector.data(), byteVector.size(), 1);
	//handlePackets(fixedPacket, false);
	//enet_packet_destroy(fixedPacket);
}

void GameClient::handleKeyCheck(ENetPacket *packet)
{
	std::cout << "PKT_KeyCheck received!" << std::endl;
	//std::cout << createDump(packet->data, packet->dataLength).c_str() << std::endl;

	if (!m_stopQuery && !m_queryThreadStarted)
	{
		m_queryThreadStarted = true;
		CreateThread(0, 0, queryThread, 0, 0, 0);
	}
}

void GameClient::handleSendGameNumber(ENetPacket *packet)
{
	std::cout << "PKT_World_SendGameNumber received!" << std::endl;

	WorldGameNumber *info = (WorldGameNumber*)packet->data;

	m_ownSummonerName = (char*)info->summonerName;
	m_gameId = info->gameId;
}

void GameClient::handleQueryStatusAns(ENetPacket *packet)
{
	if (!m_versionSynched)
	{
		m_versionSynched = true;
		m_stopQuery = true;

		std::cout << "PKT_S2C_QueryStatusAns received! - " << std::endl;

		//For Summoners Rift
		if (m_levelLimit == "LEVEL_30")
		{
			uint8_t versionSyncData[] =
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x33, 0x2E, 0x30, 0x2E, 0x32, 0x36, 0x35, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x8C, 0xF9, 0x03, 0xEA, 0xF8, 0xC3, 0x77, 0x57, 0x6E, 0x6F, 0x75, 0x14, 0xF3, 0x2A, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x8C, 0xF9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x53, 0xC0, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xF3, 0x2A, 0x00, 0x0A, 0x01, 0xC3, 0x77, 0x44, 0xF3, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0xF7, 0x2A, 0x00, 0x70, 0x00, 0xC3, 0x77, 0xC0, 0x8C, 0xF9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x10, 0x69, 0x68, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x94, 0x09, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x09, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0xD3, 0x07, 0x1E, 0x01, 0x94, 0x09, 0x03, 0x00, 0x01, 0x42, 0xB2, 0x75, 0x94, 0x09, 0x03, 0x00, 0x94, 0x09, 0x00, 0x00, 0xC8, 0xF3, 0x2A, 0x00, 0xC5, 0x96, 0x6F, 0x75, 0xC0, 0x8C, 0xF9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x50, 0x3B, 0x51, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xD4, 0xF3, 0x2A, 0x00, 0xB3, 0x1D, 0xE8, 0x75, 0x54, 0x7B, 0x14, 0x08, 0xE0, 0xF4, 0x10, 0x08, 0xF8, 0xF3, 0x2A, 0x00, 0x48, 0x23, 0xE8, 0x75, 0x50 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x34, 0x2E, 0x30, 0x2E, 0x33, 0x35, 0x31, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x7F, 0xBF, 0x03, 0xEA, 0xF8, 0x18, 0x77, 0x57, 0x6E, 0xC4, 0x74, 0xB4, 0xF7, 0x1D, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xBF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x53, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0xF8, 0x1D, 0x00, 0x0A, 0x01, 0x18, 0x77, 0xE4, 0xF7, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xFB, 0x1D, 0x00, 0x70, 0x00, 0x18, 0x77, 0x00, 0x7F, 0xBF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x10, 0xE7, 0x6E, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x18, 0x0B, 0x0F, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0B, 0x0F, 0x00, 0x81, 0x02, 0x00, 0x00, 0x39, 0x0A, 0x20, 0x07, 0x18, 0x0B, 0x0F, 0x00, 0x01, 0x42, 0xD5, 0x74, 0x18, 0x0B, 0x0F, 0x00, 0x18, 0x0B, 0x00, 0x00, 0x68, 0xF8, 0x1D, 0x00, 0xC5, 0x96, 0xC4, 0x74, 0x00, 0x7F, 0xBF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0xC1, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x74, 0xF8, 0x1D, 0x00, 0xB3, 0x1D, 0xB6, 0x75, 0xFC, 0x8A, 0x95, 0x07, 0x00, 0xF9, 0x8C, 0x07, 0x98, 0xF8, 0x1D, 0x00, 0x48, 0x23, 0xB6, 0x75, 0xF8 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x35, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x38, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xA8, 0xAB, 0x9C, 0x03, 0x01, 0x00, 0x00, 0x00, 0x84, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x49, 0x06, 0x3A, 0x01, 0x90, 0xA2, 0x9C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x84, 0x06, 0x03, 0x00, 0x84, 0x06, 0x00, 0x00, 0x78, 0xF6, 0x19, 0x00, 0xC5, 0x96, 0xCA, 0x74, 0x80, 0xAB, 0x9C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x70, 0xE5, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x84, 0xF6, 0x19, 0x00, 0xB3, 0x1D, 0x3A, 0x76, 0x1C, 0xAC, 0xB5, 0x06, 0x18, 0x10, 0xF2, 0x06, 0xA8, 0xF6, 0x19, 0x00, 0x48, 0x23, 0x3A, 0x76, 0x18, 0xAC, 0xB5, 0x06, 0x49, 0x06, 0x3A, 0x01, 0x84, 0x06, 0x03, 0x00, 0x49, 0x06, 0x3A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xC4, 0xF6, 0x19, 0x00, 0xE7, 0xD9, 0xCA, 0x74, 0xEF, 0xD9, 0xCA, 0x74, 0x84, 0x06, 0x03, 0x00, 0x49, 0x06, 0x3A, 0x01, 0x84, 0x06, 0x03, 0x00, 0xE8, 0xFD, 0xBE, 0x06, 0x18, 0xF9, 0x19, 0x00, 0xF9, 0xAD, 0xCA, 0x74, 0x84, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x32, 0x9C, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0xCA, 0x74, 0x28, 0xF6, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xF7, 0x19, 0x00, 0xF5, 0x71, 0x29, 0x77, 0x6E, 0xC0, 0x0F, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xD3, 0x3C, 0x25, 0x77, 0xFE, 0x3C, 0x25, 0x77, 0xF8, 0x0F, 0x00, 0x00, 0x00 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x36, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x38, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB0, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0xE1, 0x06, 0x04, 0x01, 0xB0, 0x06, 0x03, 0x00, 0x01, 0x42, 0x97, 0x76, 0xB0, 0x06, 0x03, 0x00, 0xB0, 0x06, 0x00, 0x00, 0xA8, 0xF9, 0x27, 0x00, 0xC5, 0x96, 0x40, 0x76, 0xD0, 0xF1, 0xE2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3A, 0x79, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB4, 0xF9, 0x27, 0x00, 0xB3, 0x1D, 0xFD, 0x76, 0xD4, 0x21, 0x62, 0x06, 0x40, 0xFF, 0x6F, 0x07, 0xD8, 0xF9, 0x27, 0x00, 0x48, 0x23, 0xFD, 0x76, 0xD0, 0x21, 0x62, 0x06, 0xE1, 0x06, 0x04, 0x01, 0xB0, 0x06, 0x03, 0x00, 0xE1, 0x06, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xF4, 0xF9, 0x27, 0x00, 0xE7, 0xD9, 0x40, 0x76, 0xEF, 0xD9, 0x40, 0x76, 0xB0, 0x06, 0x03, 0x00, 0xE1, 0x06, 0x04, 0x01, 0xB0, 0x06, 0x03, 0x00, 0x98, 0x90, 0x3D, 0x07, 0x48, 0xFC, 0x27, 0x00, 0xF9, 0xAD, 0x40, 0x76, 0xB0, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xF4, 0xE2, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x40, 0x76, 0xF4, 0x01, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x28, 0xAE, 0x5E, 0x07, 0x01, 0x00, 0x00, 0x00, 0x50, 0xD1, 0x33, 0x74, 0x00, 0xD0, 0x33, 0x74, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x74 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x36, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x38, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x06, 0x14, 0x00, 0x81, 0x02, 0x00, 0x00, 0x6D, 0x10, 0xA4, 0x02, 0xCE, 0x06, 0x14, 0x00, 0x01, 0x42, 0x97, 0x76, 0xCE, 0x06, 0x14, 0x00, 0xCE, 0x06, 0x00, 0x00, 0x80, 0xF4, 0x09, 0x00, 0xC5, 0x96, 0x40, 0x76, 0xB0, 0xCA, 0x84, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3A, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xF4, 0x09, 0x00, 0xB3, 0x1D, 0xFD, 0x76, 0xFC, 0xB2, 0x22, 0x06, 0xE8, 0xEF, 0xBE, 0x06, 0xB0, 0xF4, 0x09, 0x00, 0x48, 0x23, 0xFD, 0x76, 0xF8, 0xB2, 0x22, 0x06, 0x6D, 0x10, 0xA4, 0x02, 0xCE, 0x06, 0x14, 0x00, 0x6D, 0x10, 0xA4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xCC, 0xF4, 0x09, 0x00, 0xE7, 0xD9, 0x40, 0x76, 0xEF, 0xD9, 0x40, 0x76, 0xCE, 0x06, 0x14, 0x00, 0x6D, 0x10, 0xA4, 0x02, 0xCE, 0x06, 0x14, 0x00, 0x88, 0xEF, 0xBE, 0x06, 0x20, 0xF7, 0x09, 0x00, 0xF9, 0xAD, 0x40, 0x76, 0xCE, 0x06, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xCB, 0x84, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x40, 0x76, 0xF4, 0x01, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x68, 0x89, 0xFC, 0x06, 0x85, 0x02, 0x00, 0x87, 0x50, 0xD1, 0x33, 0x74, 0x00, 0xD0, 0x33, 0x74, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x01 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x36, 0x2E, 0x30, 0x2E, 0x32, 0x35, 0x33, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x06, 0x46, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xE8, 0x81, 0xCA, 0x03, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x06, 0x46, 0x00, 0x81, 0x02, 0x00, 0x00, 0x07, 0x09, 0xF8, 0x00, 0x00, 0x01, 0xCE, 0x03, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x06, 0x46, 0x00, 0xCE, 0x06, 0x00, 0x00, 0x90, 0xF6, 0x20, 0x00, 0xC5, 0x96, 0x46, 0x76, 0xC0, 0x81, 0xCA, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3A, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x9C, 0xF6, 0x20, 0x00, 0xB3, 0x1D, 0xCF, 0x74, 0xD4, 0xB3, 0x8D, 0x06, 0x18, 0x93, 0x32, 0x07, 0xC0, 0xF6, 0x20, 0x00, 0x48, 0x23, 0xCF, 0x74, 0xD0, 0xB3, 0x8D, 0x06, 0x07, 0x09, 0xF8, 0x00, 0xCE, 0x06, 0x46, 0x00, 0x07, 0x09, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xDC, 0xF6, 0x20, 0x00, 0xE7, 0xD9, 0x46, 0x76, 0xEF, 0xD9, 0x46, 0x76, 0xCE, 0x06, 0x46, 0x00, 0x07, 0x09, 0xF8, 0x00, 0xCE, 0x06, 0x46, 0x00, 0x50, 0xF9, 0x92, 0x06, 0x30, 0xF9, 0x20, 0x00, 0xF9, 0xAD, 0x46, 0x76, 0xCE, 0x06, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0xD3, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x46, 0x76, 0xF4, 0x01, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0xF8, 0xE9, 0xF0, 0x06, 0x0F, 0x01, 0x00, 0x0E, 0x50, 0xD1, 0x78, 0x73, 0x00, 0xD0, 0x78, 0x73, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x6A };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x37, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x33, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x98, 0x20, 0xE0, 0x03, 0x01, 0x00, 0x00, 0x00, 0x8E, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x8B, 0x05, 0x00, 0x01, 0x10, 0x1F, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x8E, 0x06, 0x01, 0x00, 0x8E, 0x06, 0x00, 0x00, 0xC8, 0xF2, 0x2A, 0x00, 0xC5, 0x96, 0x70, 0x75, 0x70, 0x20, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xBC, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xD4, 0xF2, 0x2A, 0x00, 0xB3, 0x1D, 0xF3, 0x75, 0xDC, 0x2D, 0xBE, 0x06, 0x40, 0x6A, 0x45, 0x07, 0xF8, 0xF2, 0x2A, 0x00, 0x48, 0x23, 0xF3, 0x75, 0xD8, 0x2D, 0xBE, 0x06, 0x8B, 0x05, 0x00, 0x01, 0x8E, 0x06, 0x01, 0x00, 0x8B, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x14, 0xF3, 0x2A, 0x00, 0xE7, 0xD9, 0x70, 0x75, 0xEF, 0xD9, 0x70, 0x75, 0x8E, 0x06, 0x01, 0x00, 0x8B, 0x05, 0x00, 0x01, 0x8E, 0x06, 0x01, 0x00, 0x38, 0x8C, 0xFC, 0x06, 0x68, 0xF5, 0x2A, 0x00, 0xF9, 0xAD, 0x70, 0x75, 0x8E, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xEF, 0xDF, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x70, 0x75, 0xF4, 0x01, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0xD0, 0x98, 0xFC, 0x06, 0x53, 0x0C, 0x00, 0x5F, 0x50, 0xD1, 0x57, 0x0B, 0x00, 0x52, 0x75, 0x6E, 0x6E, 0x69, 0x6E, 0x67, 0x00, 0x07, 0x00, 0x00, 0x01 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x38, 0x2E, 0x30, 0x2E, 0x32, 0x37, 0x31, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x39, 0x2E, 0x30, 0x2E, 0x34, 0x33, 0x35, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x32, 0x30, 0x2E, 0x30, 0x2E, 0x33, 0x31, 0x35, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
			{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x32, 0x31, 0x2E, 0x30, 0x2E, 0x33, 0x39, 0x30, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

			versionSyncData[5] = (uint8_t)m_pServerPeer->outgoingPeerID;
			sendEncryptedPacket(versionSyncData, sizeof(versionSyncData), CHL_C2S);
		}
		else
		{
			//For Dominion
			uint8_t versionSyncData[] =
				//{ 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x36, 0x2E, 0x30, 0x2E, 0x32, 0x30, 0x31, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0xB8, 0xF7, 0x28, 0x00, 0x91, 0x6D, 0x50, 0x75, 0x51, 0x6D, 0x50, 0x75, 0xEA, 0xCB, 0x8F, 0x6D, 0x81, 0x02, 0x00, 0x00, 0x00, 0xD2, 0xEF, 0x03, 0x41, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0x6C, 0x50, 0x75, 0x91, 0x6D, 0x50, 0x75, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0xF7, 0x28, 0x00, 0xB4, 0xF7, 0x28, 0x00, 0x9C, 0xFB, 0x28, 0x00, 0x1E, 0xA6, 0x56, 0x75, 0x0A, 0x51, 0xF7, 0x18, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x10, 0x9C, 0x7D, 0x01, 0x88, 0x06, 0x7E, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x28, 0xD2, 0xEF, 0x03, 0x01, 0x00, 0x00, 0x00, 0x88, 0x06, 0x7E, 0x00, 0x81, 0x02, 0x00, 0x00, 0xC9, 0x05, 0x96, 0x08, 0x00, 0xD7, 0xF1, 0x03, 0x00, 0x00, 0x00, 0x00, 0x88, 0x06, 0x7E, 0x00, 0x88, 0x06, 0x00, 0x00, 0x20, 0xF8, 0x28, 0x00, 0xC5, 0x96, 0x50, 0x75, 0x00, 0xD2, 0xEF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x9C, 0x7D, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x2C, 0xF8, 0x28, 0x00, 0xB3, 0x1D, 0x84, 0x76, 0x1C, 0x90, 0xB9, 0x06, 0xC8, 0xFF, 0x55, 0x00, 0x50, 0xF8, 0x28, 0x00, 0x48, 0x23, 0x84, 0x76, 0x18 };
				//{ 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x37, 0x2E, 0x30, 0x2E, 0x32, 0x39, 0x36, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x40, 0x33, 0xD8, 0x03, 0xEA, 0xF8, 0x8D, 0x77, 0x57, 0x6E, 0xA4, 0x75, 0x54, 0xF3, 0xCD, 0x02, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x33, 0xD8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x53, 0x2C, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xF3, 0xCD, 0x02, 0x0A, 0x01, 0x8D, 0x77, 0x84, 0xF3, 0xCD, 0x02, 0x00, 0x00, 0x00, 0x00, 0x84, 0xF7, 0xCD, 0x02, 0x70, 0x00, 0x8D, 0x77, 0x40, 0x33, 0xD8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xD0, 0x49, 0x54, 0x00, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x6E, 0x08, 0x08, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x08, 0x08, 0x00, 0x81, 0x02, 0x00, 0x00, 0x27, 0x06, 0xE6, 0x06, 0x6E, 0x08, 0x08, 0x00, 0x01, 0x42, 0x96, 0x75, 0x6E, 0x08, 0x08, 0x00, 0x6E, 0x08, 0x00, 0x00, 0x08, 0xF4, 0xCD, 0x02, 0xC5, 0x96, 0xA4, 0x75, 0x40, 0x33, 0xD8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x49, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x14, 0xF4, 0xCD, 0x02, 0xB3, 0x1D, 0x80, 0x75, 0x7C, 0x38, 0xCF, 0x06, 0x48, 0x0F, 0x52, 0x06, 0x38, 0xF4, 0xCD, 0x02, 0x48, 0x23, 0x80, 0x75, 0x78 };
				//{ 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x38, 0x2E, 0x30, 0x2E, 0x31, 0x37, 0x39, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x98, 0xF7, 0x27, 0x00, 0x91, 0x6D, 0x72, 0x75, 0x51, 0x6D, 0x72, 0x75, 0xBC, 0x61, 0xF8, 0x64, 0x81, 0x02, 0x00, 0x00, 0x40, 0xCE, 0xB5, 0x03, 0x41, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0x6C, 0x72, 0x75, 0x91, 0x6D, 0x72, 0x75, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0xF7, 0x27, 0x00, 0x94, 0xF7, 0x27, 0x00, 0x7C, 0xFB, 0x27, 0x00, 0x1E, 0xA6, 0x78, 0x75, 0x7C, 0xFB, 0xAD, 0x11, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x50, 0x4E, 0x46, 0x01, 0xD4, 0x05, 0x19, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x68, 0xCE, 0xB5, 0x03, 0x01, 0x00, 0x00, 0x00, 0xD4, 0x05, 0x19, 0x00, 0x81, 0x02, 0x00, 0x00, 0x55, 0x03, 0x53, 0x00, 0x90, 0xCD, 0xB5, 0x03, 0x00, 0x00, 0x00, 0x00, 0xD4, 0x05, 0x19, 0x00, 0xD4, 0x05, 0x00, 0x00, 0x00, 0xF8, 0x27, 0x00, 0xC5, 0x96, 0x72, 0x75, 0x40, 0xCE, 0xB5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4E, 0x46, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0C, 0xF8, 0x27, 0x00, 0xB3, 0x1D, 0xF7, 0x75, 0x04, 0xC1, 0x2F, 0x06, 0x18, 0x1E, 0x2B, 0x06, 0x30, 0xF8, 0x27, 0x00, 0x48, 0x23, 0xF7, 0x75, 0x00 };
				//{ 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x39, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x39, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x90, 0xF7, 0x09, 0x00, 0x91, 0x6D, 0x1D, 0x77, 0x51, 0x6D, 0x1D, 0x77, 0xFA, 0xAC, 0x38, 0xFF, 0x81, 0x02, 0x00, 0x00, 0x40, 0x03, 0xC0, 0x03, 0x41, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0x6C, 0x1D, 0x77, 0x91, 0x6D, 0x1D, 0x77, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0xF7, 0x09, 0x00, 0x8C, 0xF7, 0x09, 0x00, 0x74, 0xFB, 0x09, 0x00, 0x1E, 0xA6, 0x23, 0x77, 0x32, 0x36, 0x2C, 0x88, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0xF0, 0x91, 0xD2, 0x00, 0x74, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x68, 0x03, 0xC0, 0x03, 0x01, 0x00, 0x00, 0x00, 0x74, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x81, 0x10, 0xC0, 0x00, 0x80, 0xDB, 0xBF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x74, 0x06, 0x03, 0x00, 0x74, 0x06, 0x00, 0x00, 0xF8, 0xF7, 0x09, 0x00, 0xC5, 0x96, 0x1D, 0x77, 0x40, 0x03, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x91, 0xD2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x04, 0xF8, 0x09, 0x00, 0xB3, 0x1D, 0x52, 0x77, 0xAC, 0x8D, 0x30, 0x07, 0x10, 0xAA, 0x8D, 0x07, 0x28, 0xF8, 0x09, 0x00, 0x48, 0x23, 0x52, 0x77, 0xA8 };
				//{ 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x30, 0x2E, 0x30, 0x2E, 0x33, 0x36, 0x39, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0xF9, 0x09, 0x00, 0x91, 0x6D, 0x8F, 0x75, 0x51, 0x6D, 0x8F, 0x75, 0x02, 0xB4, 0x49, 0x3C, 0x81, 0x02, 0x00, 0x00, 0x90, 0xBB, 0x80, 0x03, 0x41, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0x6C, 0x8F, 0x75, 0x91, 0x6D, 0x8F, 0x75, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xF8, 0x09, 0x00, 0x54, 0xF9, 0x09, 0x00, 0x3C, 0xFD, 0x09, 0x00, 0x1E, 0xA6, 0x95, 0x75, 0x02, 0x20, 0xCF, 0x49, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x30, 0x43, 0x6D, 0x00, 0x02, 0x03, 0x02, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xB8, 0xBB, 0x80, 0x03, 0x01, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x00, 0x81, 0x02, 0x00, 0x00, 0xE9, 0x01, 0xB1, 0x0F, 0x30, 0xBA, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x03, 0x02, 0x00, 0x02, 0x03, 0x00, 0x00, 0xC0, 0xF9, 0x09, 0x00, 0xC5, 0x96, 0x8F, 0x75, 0x90, 0xBB, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xF9, 0x09, 0x00, 0xB3, 0x1D, 0x07, 0x77, 0xD4, 0xFA, 0xE6, 0x06, 0x88, 0xD5, 0x9D, 0x06, 0xF0, 0xF9, 0x09, 0x00, 0x48, 0x23, 0x07, 0x77, 0xD0 };
				//{0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x30, 0x2E, 0x30, 0x2E, 0x33, 0x37, 0x39, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x92, 0xAD, 0x03, 0xEA, 0xF8, 0x68, 0x77, 0x57, 0x6E, 0x4E, 0x76, 0xC4, 0xF2, 0xD1, 0x02, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x92, 0xAD, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x53, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0xF3, 0xD1, 0x02, 0x0A, 0x01, 0x68, 0x77, 0xF4, 0xF2, 0xD1, 0x02, 0x00, 0x00, 0x00, 0x00, 0xF4, 0xF6, 0xD1, 0x02, 0x70, 0x00, 0x68, 0x77, 0x20, 0x92, 0xAD, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xA0, 0xBA, 0x24, 0x74, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x9C, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0xA5, 0x06, 0x78, 0x00, 0x9C, 0x06, 0x01, 0x00, 0x01, 0x42, 0x2A, 0x76, 0x9C, 0x06, 0x01, 0x00, 0x9C, 0x06, 0x00, 0x00, 0x78, 0xF3, 0xD1, 0x02, 0xC5, 0x96, 0x4E, 0x76, 0x20, 0x92, 0xAD, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x84, 0xF3, 0xD1, 0x02, 0xB3, 0x1D, 0x4E, 0x75, 0x2C, 0x60, 0x19, 0x07, 0x48, 0x29, 0x3D, 0x07, 0xA8, 0xF3, 0xD1, 0x02, 0x48, 0x23, 0x4E, 0x75, 0x28};
				//{0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x31, 0x2E, 0x30, 0x2E, 0x33, 0x38, 0x36, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0xC2, 0xF9, 0x03, 0xEA, 0xF8, 0xB5, 0x77, 0x57, 0x6E, 0x04, 0x76, 0x04, 0xF8, 0x13, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xC2, 0xF9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x53, 0xE2, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0xF8, 0x13, 0x00, 0x0A, 0x01, 0xB5, 0x77, 0x34, 0xF8, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0xFC, 0x13, 0x00, 0x70, 0x00, 0xB5, 0x77, 0xD0, 0xC2, 0xF9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xA0, 0xBA, 0x92, 0x6D, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0xEE, 0x04, 0x22, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEE, 0x04, 0x22, 0x00, 0x81, 0x02, 0x00, 0x00, 0x43, 0x0E, 0x2B, 0x04, 0xEE, 0x04, 0x22, 0x00, 0x01, 0x42, 0xAE, 0x75, 0xEE, 0x04, 0x22, 0x00, 0xEE, 0x04, 0x00, 0x00, 0xB8, 0xF8, 0x13, 0x00, 0xC5, 0x96, 0x04, 0x76, 0xD0, 0xC2, 0xF9, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0xB9, 0x88, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xF8, 0x13, 0x00, 0xB3, 0x1D, 0xA5, 0x75, 0x34, 0x1F, 0x7C, 0x05, 0x28, 0xE7, 0xF8, 0x06, 0xE8, 0xF8, 0x13, 0x00, 0x48, 0x23, 0xA5, 0x75, 0x30};
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x32, 0x2E, 0x30, 0x2E, 0x33, 0x35, 0x36, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0xF3, 0x10, 0x00, 0x91, 0x6D, 0x34, 0x76, 0x51, 0x6D, 0x34, 0x76, 0x93, 0x7C, 0xC8, 0x5B, 0x81, 0x02, 0x00, 0x00, 0x50, 0x64, 0xFA, 0x03, 0x41, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE9, 0x6C, 0x34, 0x76, 0x91, 0x6D, 0x34, 0x76, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0xF3, 0x10, 0x00, 0xC4, 0xF3, 0x10, 0x00, 0xAC, 0xF7, 0x10, 0x00, 0x1E, 0xA6, 0x3A, 0x76, 0x03, 0xE2, 0xEC, 0x2D, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x50, 0x69, 0x87, 0x01, 0x04, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x78, 0x64, 0xFA, 0x03, 0x01, 0x00, 0x00, 0x00, 0x04, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x17, 0x06, 0x47, 0x00, 0xA0, 0x62, 0xFA, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06, 0x01, 0x00, 0x04, 0x06, 0x00, 0x00, 0x30, 0xF4, 0x10, 0x00, 0xC5, 0x96, 0x34, 0x76, 0x50, 0x64, 0xFA, 0x03, 0x00, 0x00, 0x00, 0x00, 0x50, 0x69, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x3C, 0xF4, 0x10, 0x00, 0xB3, 0x1D, 0x2E, 0x76, 0xBC, 0xF7, 0x27, 0x07, 0xF8, 0x2A, 0x80, 0x07, 0x60, 0xF4, 0x10, 0x00, 0x48, 0x23, 0x2E, 0x76, 0xB8 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x33, 0x2E, 0x30, 0x2E, 0x32, 0x36, 0x35, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x18, 0xEF, 0x03, 0xEA, 0xF8, 0x06, 0x77, 0x57, 0x6E, 0xFF, 0x75, 0x4C, 0xF3, 0x27, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x18, 0xEF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x53, 0x4B, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0xF3, 0x27, 0x00, 0x0A, 0x01, 0x06, 0x77, 0x7C, 0xF3, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xF7, 0x27, 0x00, 0x70, 0x00, 0x06, 0x77, 0x50, 0x18, 0xEF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x10, 0x40, 0x73, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x88, 0x07, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x07, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x6D, 0x07, 0x2C, 0x00, 0x88, 0x07, 0x03, 0x00, 0x01, 0x42, 0xEC, 0x74, 0x88, 0x07, 0x03, 0x00, 0x88, 0x07, 0x00, 0x00, 0x00, 0xF4, 0x27, 0x00, 0xC5, 0x96, 0xFF, 0x75, 0x50, 0x18, 0xEF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x50, 0x3B, 0x78, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0C, 0xF4, 0x27, 0x00, 0xB3, 0x1D, 0x12, 0x75, 0x84, 0x35, 0xC1, 0x06, 0xE0, 0x0C, 0x72, 0x07, 0x30, 0xF4, 0x27, 0x00, 0x48, 0x23, 0x12, 0x75, 0x80 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x34, 0x2E, 0x30, 0x2E, 0x33, 0x35, 0x31, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x68, 0xF6, 0x03, 0xEA, 0xF8, 0x18, 0x77, 0x57, 0x6E, 0xC4, 0x74, 0x54, 0xF7, 0x1D, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x68, 0xF6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x53, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE4, 0xF7, 0x1D, 0x00, 0x0A, 0x01, 0x18, 0x77, 0x84, 0xF7, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0xFB, 0x1D, 0x00, 0x70, 0x00, 0x18, 0x77, 0x90, 0x68, 0xF6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x10, 0xE7, 0x6E, 0x02, 0x02, 0x02, 0x02, 0x57, 0x69, 0x6E, 0x53, 0x6F, 0x63, 0x6B, 0x20, 0x32, 0x2E, 0x30, 0x00, 0x0C, 0x0B, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0B, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0xC9, 0x08, 0x7B, 0x05, 0x0C, 0x0B, 0x01, 0x00, 0x01, 0x42, 0xD5, 0x74, 0x0C, 0x0B, 0x01, 0x00, 0x0C, 0x0B, 0x00, 0x00, 0x08, 0xF8, 0x1D, 0x00, 0xC5, 0x96, 0xC4, 0x74, 0x90, 0x68, 0xF6, 0x03, 0x00, 0x00, 0x00, 0x00, 0x30, 0xC1, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x14, 0xF8, 0x1D, 0x00, 0xB3, 0x1D, 0xB6, 0x75, 0xD4, 0x10, 0xEE, 0x06, 0x68, 0x28, 0x30, 0x07, 0x38, 0xF8, 0x1D, 0x00, 0x48, 0x23, 0xB6, 0x75, 0xD0 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x35, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x38, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xA8, 0xAB, 0x9C, 0x03, 0x01, 0x00, 0x00, 0x00, 0x84, 0x06, 0x03, 0x00, 0x81, 0x02, 0x00, 0x00, 0x49, 0x06, 0x3A, 0x01, 0x90, 0xA2, 0x9C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x84, 0x06, 0x03, 0x00, 0x84, 0x06, 0x00, 0x00, 0x78, 0xF6, 0x19, 0x00, 0xC5, 0x96, 0xCA, 0x74, 0x80, 0xAB, 0x9C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x70, 0xE5, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x84, 0xF6, 0x19, 0x00, 0xB3, 0x1D, 0x3A, 0x76, 0x1C, 0xAC, 0xB5, 0x06, 0x18, 0x10, 0xF2, 0x06, 0xA8, 0xF6, 0x19, 0x00, 0x48, 0x23, 0x3A, 0x76, 0x18, 0xAC, 0xB5, 0x06, 0x49, 0x06, 0x3A, 0x01, 0x84, 0x06, 0x03, 0x00, 0x49, 0x06, 0x3A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xC4, 0xF6, 0x19, 0x00, 0xE7, 0xD9, 0xCA, 0x74, 0xEF, 0xD9, 0xCA, 0x74, 0x84, 0x06, 0x03, 0x00, 0x49, 0x06, 0x3A, 0x01, 0x84, 0x06, 0x03, 0x00, 0xE8, 0xFD, 0xBE, 0x06, 0x18, 0xF9, 0x19, 0x00, 0xF9, 0xAD, 0xCA, 0x74, 0x84, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x32, 0x9C, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0xCA, 0x74, 0x28, 0xF6, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xF7, 0x19, 0x00, 0xF5, 0x71, 0x29, 0x77, 0x6E, 0xC0, 0x0F, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xD3, 0x3C, 0x25, 0x77, 0xFE, 0x3C, 0x25, 0x77, 0xF8, 0x0F, 0x00, 0x00, 0x00 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x36, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x38, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xB1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC, 0x06, 0x02, 0x00, 0x81, 0x02, 0x00, 0x00, 0xAF, 0x06, 0x0A, 0x00, 0xAC, 0x06, 0x02, 0x00, 0x01, 0x42, 0x97, 0x76, 0xAC, 0x06, 0x02, 0x00, 0xAC, 0x06, 0x00, 0x00, 0x70, 0xF2, 0x11, 0x00, 0xC5, 0x96, 0x40, 0x76, 0xA0, 0x7D, 0xE3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3A, 0x79, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xF2, 0x11, 0x00, 0xB3, 0x1D, 0xFD, 0x76, 0x54, 0x99, 0xCE, 0x06, 0x58, 0x88, 0xF2, 0x06, 0xA0, 0xF2, 0x11, 0x00, 0x48, 0x23, 0xFD, 0x76, 0x50, 0x99, 0xCE, 0x06, 0xAF, 0x06, 0x0A, 0x00, 0xAC, 0x06, 0x02, 0x00, 0xAF, 0x06, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xBC, 0xF2, 0x11, 0x00, 0xE7, 0xD9, 0x40, 0x76, 0xEF, 0xD9, 0x40, 0x76, 0xAC, 0x06, 0x02, 0x00, 0xAF, 0x06, 0x0A, 0x00, 0xAC, 0x06, 0x02, 0x00, 0x40, 0xE1, 0xBC, 0x06, 0x10, 0xF5, 0x11, 0x00, 0xF9, 0xAD, 0x40, 0x76, 0xAC, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7F, 0xE3, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x40, 0x76, 0xF4, 0x01, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x30, 0x68, 0x30, 0x07, 0x1B, 0x07, 0x00, 0x1C, 0x50, 0xD1, 0x33, 0x74, 0x00, 0xD0, 0x33, 0x74, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x01 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x36, 0x2E, 0x30, 0x2E, 0x32, 0x35, 0x33, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x06, 0x46, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xE8, 0x81, 0xCA, 0x03, 0x01, 0x00, 0x00, 0x00, 0xCE, 0x06, 0x46, 0x00, 0x81, 0x02, 0x00, 0x00, 0x07, 0x09, 0xF8, 0x00, 0x00, 0x01, 0xCE, 0x03, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x06, 0x46, 0x00, 0xCE, 0x06, 0x00, 0x00, 0x90, 0xF6, 0x20, 0x00, 0xC5, 0x96, 0x46, 0x76, 0xC0, 0x81, 0xCA, 0x03, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3A, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x9C, 0xF6, 0x20, 0x00, 0xB3, 0x1D, 0xCF, 0x74, 0xD4, 0xB3, 0x8D, 0x06, 0x18, 0x93, 0x32, 0x07, 0xC0, 0xF6, 0x20, 0x00, 0x48, 0x23, 0xCF, 0x74, 0xD0, 0xB3, 0x8D, 0x06, 0x07, 0x09, 0xF8, 0x00, 0xCE, 0x06, 0x46, 0x00, 0x07, 0x09, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0xDC, 0xF6, 0x20, 0x00, 0xE7, 0xD9, 0x46, 0x76, 0xEF, 0xD9, 0x46, 0x76, 0xCE, 0x06, 0x46, 0x00, 0x07, 0x09, 0xF8, 0x00, 0xCE, 0x06, 0x46, 0x00, 0x50, 0xF9, 0x92, 0x06, 0x30, 0xF9, 0x20, 0x00, 0xF9, 0xAD, 0x46, 0x76, 0xCE, 0x06, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0xD3, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x46, 0x76, 0xF4, 0x01, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0xF8, 0xE9, 0xF0, 0x06, 0x0F, 0x01, 0x00, 0x0E, 0x50, 0xD1, 0x78, 0x73, 0x00, 0xD0, 0x78, 0x73, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x07, 0x00, 0x00, 0x6A };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x37, 0x2E, 0x30, 0x2E, 0x32, 0x33, 0x33, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x98, 0x20, 0xE0, 0x03, 0x01, 0x00, 0x00, 0x00, 0x8E, 0x06, 0x01, 0x00, 0x81, 0x02, 0x00, 0x00, 0x8B, 0x05, 0x00, 0x01, 0x10, 0x1F, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x8E, 0x06, 0x01, 0x00, 0x8E, 0x06, 0x00, 0x00, 0xC8, 0xF2, 0x2A, 0x00, 0xC5, 0x96, 0x70, 0x75, 0x70, 0x20, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xBC, 0x5E, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xD4, 0xF2, 0x2A, 0x00, 0xB3, 0x1D, 0xF3, 0x75, 0xDC, 0x2D, 0xBE, 0x06, 0x40, 0x6A, 0x45, 0x07, 0xF8, 0xF2, 0x2A, 0x00, 0x48, 0x23, 0xF3, 0x75, 0xD8, 0x2D, 0xBE, 0x06, 0x8B, 0x05, 0x00, 0x01, 0x8E, 0x06, 0x01, 0x00, 0x8B, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xC0, 0x14, 0xF3, 0x2A, 0x00, 0xE7, 0xD9, 0x70, 0x75, 0xEF, 0xD9, 0x70, 0x75, 0x8E, 0x06, 0x01, 0x00, 0x8B, 0x05, 0x00, 0x01, 0x8E, 0x06, 0x01, 0x00, 0x38, 0x8C, 0xFC, 0x06, 0x68, 0xF5, 0x2A, 0x00, 0xF9, 0xAD, 0x70, 0x75, 0x8E, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xEF, 0xDF, 0x03, 0x87, 0x02, 0x00, 0x00, 0x0C, 0xAE, 0x70, 0x75, 0xF4, 0x01, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0xD0, 0x98, 0xFC, 0x06, 0x53, 0x0C, 0x00, 0x5F, 0x50, 0xD1, 0x57, 0x0B, 0x00, 0x52, 0x75, 0x6E, 0x6E, 0x69, 0x6E, 0x67, 0x00, 0x07, 0x00, 0x00, 0x01 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x31, 0x38, 0x2E, 0x30, 0x2E, 0x32, 0x37, 0x31, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
				//{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x32, 0x30, 0x2E, 0x30, 0x2E, 0x33, 0x31, 0x35, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
			{ 0xBD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x34, 0x2E, 0x32, 0x31, 0x2E, 0x30, 0x2E, 0x33, 0x39, 0x30, 0x20, 0x5B, 0x50, 0x55, 0x42, 0x4C, 0x49, 0x43, 0x5D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

			versionSyncData[5] = (uint8_t)m_pServerPeer->outgoingPeerID;
			sendEncryptedPacket(versionSyncData, sizeof(versionSyncData), CHL_C2S);
		}
	}
}

void GameClient::handleHeroSpawn(ENetPacket *packet)
{
	HeroSpawn *spawnHero = (HeroSpawn*)packet->data;
	Hero *heroEntity = new Hero(spawnHero->netId, (char*)spawnHero->name, (char*)spawnHero->type, spawnHero->playerId, spawnHero->teamNumber, spawnHero->skinNo, spawnHero->isBot);

	m_heroManager.addHero(heroEntity);

	if (heroEntity->getSummonerName() == m_ownSummonerName)
	{
		if (!m_ownHeroSpawned)
		{
			m_ownHeroSpawned = true;

			OwnHeroSpawned spawned;
			spawned.header.netId = heroEntity->getNetId();

			sendEncryptedPacket((uint8_t*)&spawned, sizeof(OwnHeroSpawned), CHL_C2S);

			//UnkDominionPacket unkPacket;
			//unkPacket.header.netId = heroEntity->getNetId();

			//sendEncryptedPacket((uint8_t*)&unkPacket, sizeof(UnkDominionPacket), CHL_C2S);
		}
	}

	try
	{
		luabind::call_function<void>(m_luaState, "onHeroSpawn", heroEntity->getNetId(), heroEntity->getSummonerName(), heroEntity->getHeroName(), heroEntity->getPlayerId(), heroEntity->getTeamId(), heroEntity->getSkinNo(), heroEntity->isBot());
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onHeroSpawn (GameClient.cpp - 508) ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "UNKNOWN ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleSynchVersion(ENetPacket *packet)
{
	if (!m_charLoaded)
	{
		m_charLoaded = true;

		std::cout << "PKT_S2C_SynchVersion received!" << std::endl;

		//uint8_t percentageData[] =
		//{ 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x4F, 0x23, 0x41, 0x02, 0x00, 0x44, 0x00 };
		//
		//percentageData[5] = (uint8_t)m_pServerPeer->outgoingPeerID;
		//sendEncryptedPacket((uint8_t*)&percentageData, sizeof(percentageData), CHL_C2S);

		//for (int i = 0; i < 10; ++i)
		//{
		uint8_t unkPacket_0[] =
		{ 0x64, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00 };

		unkPacket_0[1] = (uint8_t)m_pServerPeer->outgoingPeerID;;
		sendEncryptedPacket((uint8_t*)&unkPacket_0, sizeof(unkPacket_0), 7);

		//}
	}

	CharLoaded charFinishedLoading;
	sendEncryptedPacket((uint8_t*)&charFinishedLoading, sizeof(CharLoaded), CHL_C2S);

	StartGameReq startGamReq;
	sendEncryptedPacket((uint8_t*)&startGamReq, sizeof(StartGameReq), CHL_C2S);

	//if (!m_loadingScreenThreadStarted)
	//{
	//	m_loadingScreenThreadStarted = true;
	//	CreateThread(0, 0, loadingScreenThread, 0, 0, 0);
	//}
}

void GameClient::handlePingLoadInfo(ENetPacket *packet)
{
	PingLoadInfo *loadInfo = (PingLoadInfo*)packet->data;

	std::cout << "Loadingscreen..." << std::endl;
	//std::cout << "[" << std::hex << loadInfo->userId << std::dec << "][" << loadInfo->loaded << "%][" << loadInfo->ping << "ms]" << std::endl;
}

void GameClient::handleStartGame(ENetPacket *packet)
{
	if (!m_gameStarted)
	{
		std::cout << "Game started!" << std::endl;
		m_gameStarted = true;
	}

	try
	{
		luabind::call_function<void>(m_luaState, "onStartGame");
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onStartGame (GameClient.cpp - 568) ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleStartSpawn(ENetPacket *packet)
{
	std::cout << "PKT_S2C_StartSpawn received!" << std::endl;
}

void GameClient::handleEndSpawn(ENetPacket *packet)
{
	std::cout << "PKT_S2C_EndSpawn received!" << std::endl;
}

void GameClient::handleLevelPropSpawn(ENetPacket *packet)
{
	std::cout << "PKT_S2C_LevelPropSpawn received!" << std::endl;

	//LevelPropSpawn *propSpawn = (LevelPropSpawn*)packet->data;

	//std::cout << "Spawn: "
	//		  << (char*)propSpawn->name << "(" << (char*)propSpawn->type << ") "
	//		  << "at X: " << propSpawn->x << " Y: " << propSpawn->y
	//		  << " - 0x" << std::hex << propSpawn->netId << std::endl;
}

void GameClient::handleTurretSpawn(ENetPacket *packet)
{
	//std::cout << "PKT_S2C_TurretSpawn received!" << packet->dataLength << std::endl;

	//TurretSpawn *turretSpawn = (TurretSpawn*)packet->data;

	std::cout << "Spawning Turret" << std::endl;
	//<< (char*)turretSpawn->name << "(" << (char*)turretSpawn->type << ")"
	//<< "- 0x" << std::hex << (int)turretSpawn->tID << std::endl;
}

void GameClient::handleChatBoxMessage(ENetPacket *packet)
{
	if (packet->dataLength == 62)
	{
		std::cout << "Chat -> EXIT RECEIVED. CRASH (:>)" << std::endl;
		exit(0);
	}
}

void GameClient::handleMoveAns(ENetPacket *packet)
{
	//if (m_botType == "HOST")
	//	MessageBoxA(0, createDump(packet->data, packet->dataLength).c_str(), "", 0);
}

void GameClient::handleSetScoreForTeamDominion(ENetPacket *packet)
{
	if (m_levelLimit == "LEVEL_30")
		return;

	SetScoreForTeamDominion *scoreInfo = (SetScoreForTeamDominion*)packet->data;

	//Update score in our manager
	m_pDominionMgr->updateScore(scoreInfo->teamId, scoreInfo->score);

	std::cout << std::dec << "Team (" << scoreInfo->teamId << ")'s score amounts to " << scoreInfo->score << std::endl;

	if (scoreInfo->score <= 0)
		exit(0);
}

void GameClient::handleAnnounce(ENetPacket *packet)
{
	//Announce *announce = (Announce*)packet->data;
}

void GameClient::handleCharStats(ENetPacket *packet)
{
	//if (m_levelLimit == "LEVEL_30")
	//{
	//	StatsConfirm confirm(*(uint32_t*)(packet->data + 5));

	//	//m_logFile << "[REQUEST]" << std::endl << createDump(packet->data, packet->dataLength).c_str() << std::endl;
	//	//m_logFile << "[RESPONSE]" << std::endl << createDump((uint8_t*)&confirm, sizeof(StatsConfirm)).c_str() << std::endl;

	//	sendEncryptedPacket((uint8_t*)&confirm, sizeof(StatsConfirm), CHL_C2S);
	//}

	try
	{
		luabind::call_function<void>(m_luaState, "onCharStats");
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onCharStats (GameClient.cpp - 716) ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "UNKNOWN ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleSpawnDominionTurret(ENetPacket *packet)
{
	//if (m_levelLimit == "LEVEL_30")
	//	return;

	DominionTurretSpawn *spawnedTurret = (DominionTurretSpawn*)packet->data;

	std::cout << "Dominion TurretID: 0x" << std::hex << spawnedTurret->header.netId << std::dec << std::endl;
	//std::cout << "Dominion Turret spawned!" << std::endl;

	//Register turret :)
	m_pDominionMgr->registerTurret(spawnedTurret->header.netId);
}

void GameClient::handleDominionTurretCaptured(ENetPacket *packet)
{
	//std::cout << "PKT_S2C_DominionTurretCaptured received!" << std::endl;

	//hexDump("CAPTURED_PACKET", packet->data, packet->dataLength);

	DominionTurretCaptured *capturedTurret = (DominionTurretCaptured*)packet->data;
	m_pDominionMgr->onTurretCaptured(capturedTurret->turretId, capturedTurret->teamId);
}

void GameClient::handleEndGame(ENetPacket *packet)
{
	try
	{
		//Remove turret file
		std::remove(("Logs/Dominion/" + std::to_string(m_gameId) + ".turrets").c_str());

		//Create GAMEEND file
		m_logFile.open("Logs/" + std::to_string(m_summonerId) + ".GAMEEND", std::fstream::out | std::fstream::app);

		std::cout << "Game end!" << std::endl;
		luabind::call_function<void>(m_luaState, "onGameEnd");
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "OnGameEnd (GameClient.cpp - 789) ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}

	Sleep(2000);
	exit(0);
}

void GameClient::handleLevelUp(ENetPacket *packet)
{
	LevelUp *levelUp = (LevelUp*)packet->data;

	if (levelUp->header.netId == 0)
		return;

	auto hero = m_heroManager.getHero(levelUp->header.netId);

	if (hero != nullptr)
	{
		hero->setLevel(levelUp->level);

		std::cout << "[" << hero->getHeroName() << "]" << " LEVELED UP -> LVL" << (int)levelUp->level << std::endl;
	}

	try
	{
		luabind::call_function<void>(m_luaState, "onLevelUp", levelUp->header.netId, levelUp->level, levelUp->skillPoints);
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "OnLevelUp: ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleChampionDie(ENetPacket *packet)
{
	ChampionDie *diePacket = (ChampionDie*)packet->data;

	if (diePacket->header.netId == 0)
		return;

	auto killedHero = m_heroManager.getHero(diePacket->header.netId);
	auto killerHero = m_heroManager.getHero(diePacket->killerId);

	if (killedHero != nullptr)
		std::cout << killedHero->getHeroName() << "was killed by ";
	else
		std::cout << " UNKNOWN_CHAMP was killed by ";

	if (killerHero != nullptr)
		std::cout << killerHero->getHeroName() << std::endl;
	else
		std::cout << "UNKNOWN_CHAMP" << std::endl;

	if (killedHero != nullptr)
		killedHero->setAlive(false);

	try
	{
		luabind::call_function<void>(m_luaState, "onChampDie", killedHero, killerHero);
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "OnLevelUp: ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleChampionRespawn(ENetPacket *packet)
{
	ChampionRespawn *respawnPacket = (ChampionRespawn*)packet->data;

	if (respawnPacket->header.netId == 0)
		return;

	auto respawnedHero = m_heroManager.getHero(respawnPacket->header.netId);

	if (respawnedHero != nullptr)
	{
		std::cout << respawnedHero;
		respawnedHero->setAlive(true);
	}
	else
	{
		std::cout << "UNKNOWN_CHAMP (" << respawnPacket->header.netId << ")";
	}

	std::cout << " respawned at X:" << respawnPacket->x << " Y:" << respawnPacket->y << " Z:" << respawnPacket->z << std::endl;
}

void GameClient::handleBuyItem(ENetPacket *packet)
{
	BuyItemAns *itemPacket = (BuyItemAns*)packet->data;

	if (itemPacket->header.netId <= 0xFFFF)
		return;

	auto hero = m_heroManager.getHero(itemPacket->header.netId);

	if (hero == nullptr)
	{
		std::cout << "UNKNOWN_CHAMP (" << itemPacket->header.netId << ") bought something" << std::endl;
		return;
	}

	hero->addItem(itemPacket->itemId);

	std::cout << hero->getHeroName() << " bought " << itemPacket->itemId << "[" << (int)itemPacket->stack << "]" << std::endl;
}

void GameClient::handleObjectSpawn(ENetPacket *packet)
{
	MinionSpawn *minionSpawn = (MinionSpawn*)packet->data;

	//You ain't no minion!
	if (minionSpawn->type != 0x03)
		return;

	auto minion = new Minion(minionSpawn->header.netId, minionSpawn->spawnPosition, minionSpawn->spawnType);
	m_minionManager.addMinion(minion);

	//std::cout << "Minion spawned => " << (int)minion->getTeamId() << std::endl;

	//switch (minionSpawn->spawnPosition)
	//{
	//case SPAWN_BLUE_BOT:
	//	std::cout << "SPAWN_BLUE_BOT | ";
	//	break;

	//case SPAWN_BLUE_MID:
	//	std::cout << "SPAWN_BLUE_MID | ";
	//	break;

	//case SPAWN_BLUE_TOP:
	//	std::cout << "SPAWN_BLUE_TOP | ";
	//	break;

	//case SPAWN_RED_BOT:
	//	std::cout << "SPAWN_RED_BOT | ";
	//	break;

	//case SPAWN_RED_MID:
	//	std::cout << "SPAWN_RED_MID | ";
	//	break;

	//case SPAWN_RED_TOP:
	//	std::cout << "SPAWN_RED_TOP | ";
	//	break;
	//}

	//switch (minionSpawn->spawnType)
	//{
	//case MINION_TYPE_CANNON:
	//	std::cout << "MINION_TYPE_CANNON" << std::endl;
	//	break;

	//case MINION_TYPE_CASTER:
	//	std::cout << "MINION_TYPE_CASTER" << std::endl;
	//	break;

	//case MINION_TYPE_MELEE:
	//	std::cout << "MINION_TYPE_MELEE" << std::endl;
	//	break;

	//case MINION_TYPE_SUPER:
	//	std::cout << "MINION_TYPE_SUPER" << std::endl;
	//	break;
	//}
}

void GameClient::handleNpcDie(ENetPacket *packet)
{
	NpcDie *npcDie = (NpcDie*)packet->data;
	Entity *died = nullptr;
	Entity *killer = nullptr;

	if (npcDie->header.netId == 0 || npcDie->killerId == 0)
		return;

	//Search for died entity - Minions first then Heroes!
	died = (Entity*)m_minionManager.getMinion(npcDie->header.netId);

	//if (died == nullptr)
	//	died = (Entity*)m_heroManager.getHero(npcDie->header.netId);

	//Search for killer entity - Minions first then Heroes!
	killer = (Entity*)m_minionManager.getMinion(npcDie->killerId);

	if (killer == nullptr)
		killer = (Entity*)m_heroManager.getHero(npcDie->killerId);

	if (died == nullptr && killer == nullptr)
		return;

	if (died != nullptr)
	{
		std::cout << died->getName() << " was killed by ";
		m_minionManager.removeMinion((Minion*)died);
	}
	else
	{
		std::cout << "UNKNOWN_NPC was killed by ";
	}

	if (killer != nullptr)
		std::cout << killer->getName() << std::endl;
	else
		std::cout << "UNKNOWN_NPC" << std::endl;
}

void GameClient::handleBeginAutoAttack(ENetPacket *packet)
{
	BeginAutoAttack *autoAttack = (BeginAutoAttack*)packet->data;

	if (autoAttack->header.netId == 0 || autoAttack->attackedId == 0)
		return;

	Entity *attacker = (Entity*)m_heroManager.getHero(autoAttack->header.netId);

	if (attacker == nullptr)
		attacker = (Entity*)m_minionManager.getMinion(autoAttack->header.netId);

	if (attacker == nullptr)
		return;

	Hero *attacked = m_heroManager.getHero(autoAttack->attackedId);

	if (attacked == nullptr)
		return;

	try
	{
		luabind::call_function<void>(m_luaState, "onAutoAttack", attacker, attacked);
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onAutoAttack: ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleNextAutoAttack(ENetPacket *packet)
{
	NextAutoAttack *autoAttack = (NextAutoAttack*)packet->data;

	if (autoAttack->header.netId == 0 || autoAttack->attackedId == 0)
		return;

	Entity *attacker = (Entity*)m_heroManager.getHero(autoAttack->header.netId);

	if (attacker == nullptr)
		attacker = (Entity*)m_minionManager.getMinion(autoAttack->header.netId);

	if (attacker == nullptr)
		return;

	Hero *attacked = m_heroManager.getHero(autoAttack->attackedId);

	if (attacked == nullptr)
		return;

	try
	{
		luabind::call_function<void>(m_luaState, "onAutoAttack", attacker, attacked);
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onAutoAttack: ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}
}

void GameClient::handleStopAutoAttack(ENetPacket *packet)
{
	StopAutoAttack *stopAutoAttack = (StopAutoAttack*)packet->data;

	if (stopAutoAttack->header.netId == 0)
		return;

	Entity *attacker = (Entity*)m_minionManager.getMinion(stopAutoAttack->header.netId);

	if (attacker == nullptr)
		attacker = (Entity*)m_heroManager.getHero(stopAutoAttack->header.netId);

	if (attacker == nullptr)
		return;

	try
	{
		luabind::call_function<void>(m_luaState, "onStopAutoAttack", attacker);
	}
	catch (const luabind::error &e)
	{
		std::string error = lua_tostring(e.state(), -1);
		error.insert(0, "onAutoAttack: ");

		std::cout << "LUA_ERROR: " << error.c_str() << std::endl;
	}
	catch (const std::exception &e)
	{
		std::cout << "LUA_ERROR: " << e.what() << std::endl;
	}
}